const path = require('path')
const API = require('./src/http/API.js')

function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          require('postcss-px2rem')({
            // 把px单位换算成rem单位
            remUnit: 37.5 // 设计稿宽度的1/10 此处设计稿按375px宽
          })
        ]
      },
     

     
    }
  },
  pluginOptions: { // 第三方插件配置
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [path.resolve(__dirname, './src/assets/css/base.less')] // less所在文件路径
    }
  },

  devServer: {
     https: false,
     open: false,
     proxy: {
     [API.DEV_AGENT]:{
     // '/mall': {
     target: API.BASE_URL, //'http://116.63.80.218:8082/wx/',
     ws: true, // 是否跨域
     changeOrigin: true,
     pathRewrite: {
     ['^'+API.DEV_AGENT]: ''
     }
     }
     }
   },

}
